{% extends "base.htm" %}
{% block header_title %}后台管理首页{% end %}

{% block body %}
<div class="am-cf admin-main">
  {% include "sidebar.htm" %}

  <!-- content start -->
  <div class="admin-content">

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">首页</strong> / <small>站点统计</small></div>
    </div>

    <ul class="am-avg-sm-1 am-avg-md-4 am-margin am-padding am-text-center admin-content-list ">
      <li><a href="/manage/index" class="am-text-success"><span class="am-icon-btn am-icon-file-text"></span><br/>帖子数量<br/>{{  count['article'] }}</a></li>
      <li><a href="/manage/sort" class="am-text-warning"><span class="am-icon-btn am-icon-briefcase"></span><br/>板块数量<br/>{{ count['sort'] }}</a></li>
      <li><a href="/manage/user" class="am-text-danger"><span class="am-icon-btn am-icon-recycle"></span><br/>活跃用户<br/>{{ count['active'] }}</a></li>
      <li><a href="/manage/user" class="am-text-secondary"><span class="am-icon-btn am-icon-user-md"></span><br/>用户总数<br/>{{  count['user'] }}</a></li>
    </ul>

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">新注册的用户</strong></div>
    </div>

    <div class="am-g">
      <div class="am-u-sm-12">
        <table class="am-table am-table-bd am-table-striped admin-content-table">
          <thead>
          <tr>
            <th>ID</th><th>用户名</th><th>最近登录时间</th><th>金币</th><th>管理</th>
          </tr>
          </thead>
          <tbody>
          {% set i = 1 %}
          {% for user in newusers %}
          <tr>
              <td>{{ i }}</td>
              <td>{{ user["username"] }}</td>
              <td>{{ humantime(user.get('logintime', user.get('time'))) }}</td>
              <td><span class="am-badge am-badge-success">{{ user['money'] }}</span></td>
              <td>
                  <a class="am-btn am-btn-default am-btn-xs" href="/manage/userdetail/{{ user['username'] }}">查看详情</a>
              </td>
          </tr>
          {% set i += 1 %}
          {% end %}
          </tbody>
        </table>
      </div>
    </div>

  </div>
  <!-- content end -->

</div>

<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

{% end %}